%! Tex program = xelatex
\documentclass{article}
\usepackage[UTF8, scheme = plain]{ctex}
\begin{document}
\section{TSP}
function ${TSP}(V, D)$\\
$\min _{e \in V, e \neq 1} M(V-\{e\}, e)+d_{e 1}$\\
function ${M}(S, e)$\\
1: if $S=\{v\}$ then\\
2: $\quad \mathrm{M}(S, e)=d_{1 v}+d_{v e}$\\
3: return $\mathrm{M}(S, e)$\\
4: end if\\
5: return $\min _{i \in S, i \neq e} \mathrm{M}(S-\{i\}, i)+d_{e i}$\\
$\sum_{k=2}^{n-1} k(k-1)\left(\begin{array}{c}n-1 \\ k\end{array}\right)+n-1=O\left(2^{n} n^{2}\right)$\\
从终点出发，共有k（k初始为2，由于起点已定，故最多总共n-1个）个子问题,可得公式$k(k-1)$，故取其高次项有$n^2$,考虑到每次计算后都要进行比较大小因此又有$2^n$,两者相乘可得其时间复杂度$O\left(2^{n} n^{2}\right)$
\end{document}